<!DOCTYPE html>
<html lang="cn">
<head>
    <title>WSD Admin</title>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <link rel="stylesheet" href="__STATICURL__/css/bootstrap.min.css"/>
    <link rel="stylesheet" href="__STATICURL__/css/bootstrap-responsive.min.css"/>
    <link rel="stylesheet" href="__STATICURL__/css/uniform.css"/>
    <link rel="stylesheet" href="__STATICURL__/css/select2.css"/>
    <link rel="stylesheet" href="__STATICURL__/css/matrix-style.css"/>
    <link rel="stylesheet" href="__STATICURL__/css/matrix-media.css"/>
    <link rel="stylesheet" href="__STATICURL__/css/bootstrap-wysihtml5.css"/>
    <link href="__STATICURL__/font-awesome/css/font-awesome.css" rel="stylesheet"/>
</head>
<body>
<include file="Common:header"/>
<div id="content">
    <!--breadcrumbs-->
    <div id="content-header">
        <div id="breadcrumb"><a href="__ROOT__/clover"><i class="icon-home"></i> 主页</a>
            <a href="__URL__/category_list">产品分类列表</a><a href="#" class="current">产品分类信息修改</a>
        </div>
    </div>
    <!--End-breadcrumbs-->
    <div class="container-fluid">
        <div class="row-fluid">
            <div class="span12">
                <div class="widget-box" style="margin-top:0px;">
                    <div class="widget-title"><span class="icon"> <i class="icon-th"></i> </span>
                        <h5>产品分类信息修改</h5>
                    </div>
                    <div class="widget-content nopadding">
                        <table class="table table-bordered table-striped">
                            <tbody>
                            <tr class="odd gradeX">
                                <td>分类名称</td>
                                <td>
                                    <div class="controls">
                                        <input style="width:258px;" type="text" value="{$category_info.cat_name}"
                                               class="cat_name" placeholder="输入分类名称"/>
                                    </div>
                                </td>
                            </tr>
                            <tr class="odd gradeX">
                                <td>显示顺序</td>
                                <td>
                                    <div class="controls">
                                        <input style="width:258px;" type="text" value="{$category_info.sort_order}"
                                               class="sort_order" placeholder="请输入显示顺序 注：数字"/>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <button type="" class="btn btn-success J_submit">保存</button>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!--Footer-part-->
<include file="Common:footer"/>
<!--end-Footer-part-->
<script src="__STATICURL__/js/jquery.min.js"></script>
<script src="__STATICURL__/js/jquery.ui.custom.js"></script>
<script src="__STATICURL__/js/bootstrap.min.js"></script>
<script src="__STATICURL__/js/jquery.uniform.js"></script>
<script src="__STATICURL__/js/select2.min.js"></script>
<script src="__STATICURL__/js/jquery.dataTables.min.js"></script>
<script src="__STATICURL__/js/matrix.js"></script>
<script src="__STATICURL__/js/matrix.tables.js"></script>
</body>
</html>
<script type="text/javascript">
    $(document).ready(function () {
        $(".J_submit").click(function (event) {
            var cat_name = $(".cat_name").val();
            var sort_order = $(".sort_order").val();
            var id = {$cat_id};
            if (cat_name == "") {
                alert("请输入分类名称！");
                $(".cat_name").focus();
                return false;
            }
            $.post('__URL__/do_edit_category', {id: id, cat_name: cat_name, sort_order: sort_order}, function (data) {
                if (data) {
                    alert("成功");
                    window.location.href = "__URL__/category_list";
                } else {
                    alert("添加失败");
                }
            });
        });
    });
</script>
